<template>
    <div>
<h1>修改页面</h1>
<p>名字：<input type="text" v-model="name"></p>
<p><button @click="addcate">添加</button></p>
    </div>
</template>

<script>
import axios from 'axios'
export default {
    data() {
        return {
            cate_id:this.$route.query.cate_id,
            name:'',
        }
    },
    methods: {
        addcate() {
            let fdata=new FormData()
            fdata.append('name',this.name)
            fdata.append('cate_id',this.cate_id)
            axios({
                url:'http://127.0.0.1:8000/app01/updatecate/',
                method:'put',
                data:fdata
            }).then(resp=>{
                console.log(resp.data)
            })
        }
    },
    created() {

    }
}
</script>

<style scoped>

</style>
